<template>
  <div
    class="x-option-group"
    :style="pos"
    :class="{ 'x-option-group-pc': equ === 'pc' }"
  >
    <div class="group-list scroll">
      <slot />
    </div>
  </div>
</template>

<script
  lang="ts"
  setup
  name="XOptionGroup"
>
import { equ } from '../../../../package-env'

// eslint-disable-next-line vue/require-prop-types
defineProps(['pos'])
</script>

<style
  scoped
  lang="scss"
>
.x-option-group {
  @apply absolute z-2000;
  width: 100%;
  border-radius: 6px;
  padding: 9px 15px 9px 0;
  left: 0;
  top: calc(100% + 4px);

  .group-list {
    position: relative;
    max-height: 168px;
    z-index: 1;
    margin-right: -8px;
    /* padding-right: 8px; */
    box-sizing: border-box;

    ::-webkit-scrollbar {
      width: 2px;
    }

    &::-webkit-scrollbar-thumb,
    &::-webkit-scrollbar-thumb:hover,
    &::-webkit-scrollbar-thumb:active {
      background: #4673EE;
    }
  }

  &::after {
    content: '';
    @apply block z-0 absolute top-0 left-0 right-0 bottom-0 backdrop-filter backdrop-blur-[120px];
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.15);
  }
}

.x-option-group-pc {
  padding: 9px 10px;

  &::after {
    @apply backdrop-filter backdrop-blur-10px;
    content: '';
    background: rgba(0, 0, 0, 0.5);
  }

  .group-list {
    ::-webkit-scrollbar {
      width: 2px;
    }

    &::-webkit-scrollbar-thumb,
    &::-webkit-scrollbar-thumb:hover,
    &::-webkit-scrollbar-thumb:active {
      background: #ffffff;
    }
  }
}
</style>
